package com.sskj.mine.presenter;

import android.text.TextUtils;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.SPUtil;
import com.sskj.lib.SPConfig;
import com.sskj.lib.bean.UserData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.bean.WebUrl;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.ui.activity.MineProtocalActivity;


public class MineProtocalActivityPresenter extends BasePresenter<MineProtocalActivity> {
    // 获取协议
    public void getContent(String language) {
        OkGo.<HttpData<WebUrl>>get(HttpConfig.BASE_URL + HttpConfig.MINE_PROTOCAL)
                .params("lang", language)
                .execute(new JsonCallBack<HttpData<WebUrl>>(this, true) {
                    @Override
                    public void onSuccess(Response<HttpData<WebUrl>> response) {
                        HttpData<WebUrl> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUi(httpData.getData().getReg_agree());
                        }
                    }
                });
    }

}
